/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80023
 Source Host           : localhost:3306
 Source Schema         : hsy

 Target Server Type    : MySQL
 Target Server Version : 80023
 File Encoding         : 65001

 Date: 30/03/2021 21:51:30
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for sys_ exchange
-- ----------------------------
DROP TABLE IF EXISTS `sys_ exchange`;
CREATE TABLE `sys_ exchange` (
  `exchange_id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL,
  `exchange_goal` bigint DEFAULT NULL COMMENT '兑换消耗积分',
  `book_id` bigint DEFAULT NULL COMMENT '书籍id',
  `chapter_id` bigint DEFAULT NULL COMMENT '章节id',
  `ques_id` bigint DEFAULT NULL COMMENT '问题id',
  `exchange_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '兑换时间',
  PRIMARY KEY (`exchange_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_ exchange
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_book
-- ----------------------------
DROP TABLE IF EXISTS `sys_book`;
CREATE TABLE `sys_book` (
  `book_id` bigint NOT NULL AUTO_INCREMENT,
  `book_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '书籍名称',
  `file_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件名',
  `file_suffix` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '文件后缀名',
  `order_num` int DEFAULT NULL COMMENT '排序',
  `book_mark` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '书籍标签',
  `dept_id` bigint DEFAULT NULL COMMENT '年级id',
  PRIMARY KEY (`book_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_book
-- ----------------------------
BEGIN;
INSERT INTO `sys_book` VALUES (16, '少儿文学', '9da55325-21c4-4a50-af20-ebcbaa0f40a4.jpg', 'jpg', 1, '文学类', 102);
INSERT INTO `sys_book` VALUES (17, '格林童话', 'ac7ca605-1799-4c6f-baba-f68dbeffd793.jpeg', 'jpeg', 2, '童话书', 101);
COMMIT;

-- ----------------------------
-- Table structure for sys_chapter
-- ----------------------------
DROP TABLE IF EXISTS `sys_chapter`;
CREATE TABLE `sys_chapter` (
  `chapter_id` bigint NOT NULL AUTO_INCREMENT,
  `book_id` bigint DEFAULT NULL COMMENT '所属书籍',
  `file_name` varchar(255) DEFAULT NULL,
  `order_num` int DEFAULT NULL,
  `read_time` bigint DEFAULT NULL,
  `chapter_name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`chapter_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_chapter
-- ----------------------------
BEGIN;
INSERT INTO `sys_chapter` VALUES (18, 16, 'b822f2b4-4ab5-4b5c-8ae2-c46d4a3d27c1.pdf', 1, 1844, '猪八戒新传');
INSERT INTO `sys_chapter` VALUES (19, 16, '3837d209-706f-4a36-a513-bb1a754e0546.pdf', 2, 2930, '山雀的日历');
INSERT INTO `sys_chapter` VALUES (20, 16, '85731049-cc03-4500-82c2-8eb25cfef80c.pdf', 3, 2439, '树林的回声');
INSERT INTO `sys_chapter` VALUES (21, 17, '1862c8ed-5557-46fb-8a26-947128501acb.txt', 1, 50, '第一章');
INSERT INTO `sys_chapter` VALUES (22, 17, '624f3e7b-2be4-4edf-a8ff-dda6fa77dbf7.txt', 2, 30, '第二章');
INSERT INTO `sys_chapter` VALUES (23, 17, '2bac4a55-bcc9-4dd9-846a-5205d1d94b9a.txt', 3, 60, '第三章');
COMMIT;

-- ----------------------------
-- Table structure for sys_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept`;
CREATE TABLE `sys_dept` (
  `dept_id` bigint NOT NULL AUTO_INCREMENT COMMENT '部门id',
  `parent_id` bigint DEFAULT '0' COMMENT '父部门id',
  `ancestors` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '祖级列表',
  `dept_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '部门名称',
  `order_num` int DEFAULT '0' COMMENT '显示顺序',
  `leader` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '负责人',
  `phone` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '联系电话',
  `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '邮箱',
  `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '部门状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`dept_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COMMENT='部门表';

-- ----------------------------
-- Records of sys_dept
-- ----------------------------
BEGIN;
INSERT INTO `sys_dept` VALUES (100, 0, '0', '密云三小', 0, '若依', '15888888888', 'ry@qq.com', '0', '0', 'admin', '2021-02-23 10:40:59', '', NULL);
INSERT INTO `sys_dept` VALUES (101, 100, '0,100', '一年级', 1, '', '', '', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 17:30:37');
INSERT INTO `sys_dept` VALUES (102, 100, '0,100', '二年级', 2, '', '', '', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 17:40:13');
INSERT INTO `sys_dept` VALUES (103, 101, '0,100,101', '一年1班', 1, '', '', '', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 17:44:26');
INSERT INTO `sys_dept` VALUES (108, 102, '0,100,102', '二年1班', 1, '', '', '', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 17:44:32');
INSERT INTO `sys_dept` VALUES (109, 102, '0,100,102', '二年2班', 2, '', '', '', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 17:44:37');
COMMIT;

-- ----------------------------
-- Table structure for sys_dept_book
-- ----------------------------
DROP TABLE IF EXISTS `sys_dept_book`;
CREATE TABLE `sys_dept_book` (
  `book_id` bigint DEFAULT NULL,
  `dept_id` bigint DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_dept_book
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID',
  `menu_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '菜单名称',
  `parent_id` bigint DEFAULT '0' COMMENT '父菜单ID',
  `order_num` int DEFAULT '0' COMMENT '显示顺序',
  `url` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '#' COMMENT '请求地址',
  `target` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '打开方式（menuItem页签 menuBlank新窗口）',
  `menu_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '菜单类型（M目录 C菜单 F按钮）',
  `visible` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '菜单状态（0显示 1隐藏）',
  `is_refresh` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '1' COMMENT '是否刷新（0刷新 1不刷新）',
  `perms` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '权限标识',
  `icon` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '#' COMMENT '菜单图标',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '备注',
  PRIMARY KEY (`menu_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1021 DEFAULT CHARSET=utf8 COMMENT='菜单权限表';

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES (1, '系统管理', 0, 1, '#', '', 'M', '0', '1', '', 'fa fa-gear', 'admin', '2021-02-23 10:40:59', '', NULL, '系统管理目录');
INSERT INTO `sys_menu` VALUES (100, '用户管理', 1, 1, '/system/user', '', 'C', '0', '1', 'system:user:view', 'fa fa-user-o', 'admin', '2021-02-23 10:40:59', '', NULL, '用户管理菜单');
INSERT INTO `sys_menu` VALUES (101, '角色管理', 1, 2, '/system/role', '', 'C', '0', '1', 'system:role:view', 'fa fa-user-secret', 'admin', '2021-02-23 10:40:59', '', NULL, '角色管理菜单');
INSERT INTO `sys_menu` VALUES (102, '菜单管理', 1, 3, '/system/menu', '', 'C', '0', '1', 'system:menu:view', 'fa fa-th-list', 'admin', '2021-02-23 10:40:59', '', NULL, '菜单管理菜单');
INSERT INTO `sys_menu` VALUES (103, '年级管理', 1, 4, '/system/dept', 'menuItem', 'C', '0', '1', 'system:dept:view', 'fa fa-outdent', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-25 10:45:14', '部门管理菜单');
INSERT INTO `sys_menu` VALUES (1000, '用户查询', 100, 1, '#', '', 'F', '0', '1', 'system:user:list', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1001, '用户新增', 100, 2, '#', '', 'F', '0', '1', 'system:user:add', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1002, '用户修改', 100, 3, '#', '', 'F', '0', '1', 'system:user:edit', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1003, '用户删除', 100, 4, '#', '', 'F', '0', '1', 'system:user:remove', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1004, '用户导出', 100, 5, '#', '', 'F', '0', '1', 'system:user:export', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1005, '用户导入', 100, 6, '#', '', 'F', '0', '1', 'system:user:import', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1006, '重置密码', 100, 7, '#', '', 'F', '0', '1', 'system:user:resetPwd', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1007, '角色查询', 101, 1, '#', '', 'F', '0', '1', 'system:role:list', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1008, '角色新增', 101, 2, '#', '', 'F', '0', '1', 'system:role:add', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1009, '角色修改', 101, 3, '#', '', 'F', '0', '1', 'system:role:edit', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1010, '角色删除', 101, 4, '#', '', 'F', '0', '1', 'system:role:remove', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1011, '角色导出', 101, 5, '#', '', 'F', '0', '1', 'system:role:export', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1012, '菜单查询', 102, 1, '#', '', 'F', '0', '1', 'system:menu:list', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1013, '菜单新增', 102, 2, '#', '', 'F', '0', '1', 'system:menu:add', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1014, '菜单修改', 102, 3, '#', '', 'F', '0', '1', 'system:menu:edit', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1015, '菜单删除', 102, 4, '#', '', 'F', '0', '1', 'system:menu:remove', '#', 'admin', '2021-02-23 10:40:59', '', NULL, '');
INSERT INTO `sys_menu` VALUES (1016, '年级查询', 103, 1, '#', 'menuItem', 'F', '0', '1', 'system:dept:list', '#', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-25 10:45:43', '');
INSERT INTO `sys_menu` VALUES (1017, '年级新增', 103, 2, '#', 'menuItem', 'F', '0', '1', 'system:dept:add', '#', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-25 10:45:52', '');
INSERT INTO `sys_menu` VALUES (1018, '年级修改', 103, 3, '#', 'menuItem', 'F', '0', '1', 'system:dept:edit', '#', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-25 10:46:00', '');
INSERT INTO `sys_menu` VALUES (1019, '年级删除', 103, 4, '#', 'menuItem', 'F', '0', '1', 'system:dept:remove', '#', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-25 10:46:07', '');
INSERT INTO `sys_menu` VALUES (1020, '书籍管理', 1, 5, '/book/book', 'menuItem', 'C', '0', '1', NULL, '#', 'admin', '2021-03-01 14:46:17', '', NULL, '');
COMMIT;

-- ----------------------------
-- Table structure for sys_ques
-- ----------------------------
DROP TABLE IF EXISTS `sys_ques`;
CREATE TABLE `sys_ques` (
  `ques_id` bigint NOT NULL AUTO_INCREMENT,
  `chapter_id` bigint DEFAULT NULL COMMENT '对应书籍id',
  `ques_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '问题',
  `select_a` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'A选项',
  `select_b` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'B选项',
  `select_c` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'C选项',
  `select_d` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'D选项',
  `answer` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '答案',
  `order_num` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`ques_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_ques
-- ----------------------------
BEGIN;
INSERT INTO `sys_ques` VALUES (1, 11, '没头脑名字的由来', '没脑袋', '没屁股', '没腰', '没眼睛', 'A', 1);
INSERT INTO `sys_ques` VALUES (12, 11, '没头脑名字的由来1', '没脑袋', 'FFAS', '3123', '323', 'A', 4);
INSERT INTO `sys_ques` VALUES (13, NULL, '有几个问题', '1', '2', '3', '4', 'A', 1);
INSERT INTO `sys_ques` VALUES (17, 18, '猪八戒的师傅叫什么', '唐一藏', '唐二藏', '唐三藏', '唐四藏', 'C', 1);
INSERT INTO `sys_ques` VALUES (18, 18, '猪八戒吃的是什么', '芝麻', '西瓜', '柚子', '榴莲', 'B', 2);
INSERT INTO `sys_ques` VALUES (19, 18, '猪八戒有几个师傅', '1个', '2个', '3个', '4个', 'A', 3);
INSERT INTO `sys_ques` VALUES (20, 18, '猪八戒姓什么', '猪', '狗', '牛', '羊', 'A', 4);
INSERT INTO `sys_ques` VALUES (21, 18, '猪八戒去的哪里取经', '东天', '南天', '北天', '西天', 'D', 5);
INSERT INTO `sys_ques` VALUES (22, 19, '山雀的名字叫什么', '金卡', '银卡', '铜卡', '铁卡', 'A', 1);
INSERT INTO `sys_ques` VALUES (23, 19, '新年是什么时候', '1月1日', '2月2日', '3月3日', '4月4日', 'A', 2);
INSERT INTO `sys_ques` VALUES (24, 19, '暴风雪中，谁救了山雀', '老鹰', '老鼠', '啄木鸟', '狮子', 'C', 3);
INSERT INTO `sys_ques` VALUES (25, 19, '金卡给小金丝雀喂得什么', '苍蝇', '蝴蝶', '瓢虫', '蚂蚁', 'B', 4);
INSERT INTO `sys_ques` VALUES (26, 19, '一年之中最长的一天是什么时候', '6月20日', '6月21日', '6月22日', '6月23日', 'B', 5);
INSERT INTO `sys_ques` VALUES (27, 21, '本章节说的是谁的故事', '青蛙王子', '牛蛙王子', '阿拉伯王子', '英国王子', 'A', 1);
INSERT INTO `sys_ques` VALUES (28, 21, '小公主玩的是什么球', '铁球', '银球', '铜球', '金球', 'D', 2);
INSERT INTO `sys_ques` VALUES (29, 21, '青蛙最后变成了什么', '律师', '王子', '会计', '程序员', 'B', 3);
INSERT INTO `sys_ques` VALUES (30, 22, '猫和谁做了朋友', '猫头鹰', '狮子', '老鼠', '老虎', 'C', 1);
INSERT INTO `sys_ques` VALUES (31, 22, '猫为什么要和老鼠做朋友', '因为猫喜欢老鼠', '因为猫心情不好', '因为猫是老鼠变得', '因为猫想吃老鼠', 'D', 2);
INSERT INTO `sys_ques` VALUES (32, 22, '猫和老鼠最后怎么样了', '成了朋友', '猫吃了老鼠', '老鼠吃了猫', '猫吃了猫', 'B', 3);
INSERT INTO `sys_ques` VALUES (33, 22, '猪油藏在哪里', '祭坛下', '厨房里', '被子里', '床底下', 'A', 4);
INSERT INTO `sys_ques` VALUES (34, 22, '孩子取了什么名字', '没了底层', '没了顶层', '没了中间层', '没了下层', 'B', 5);
INSERT INTO `sys_ques` VALUES (35, 23, '樵夫住在哪里', '山上', '水里', '桥下', '森林边', 'D', 1);
INSERT INTO `sys_ques` VALUES (36, 23, '圣母玛利亚是谁的母亲', '耶稣', '蛋酥', '肉酥', '芝麻酥', 'A', 2);
INSERT INTO `sys_ques` VALUES (38, 23, '天国有多少扇门', '10', '11', '12', '13', 'D', 3);
INSERT INTO `sys_ques` VALUES (39, 23, '天堂里有什么喝的', '水', '牛奶', '饮料', '可乐', 'B', 4);
INSERT INTO `sys_ques` VALUES (40, 23, '王后生了几个孩子', '1', '2', '3', '4', 'A', 5);
COMMIT;

-- ----------------------------
-- Table structure for sys_read
-- ----------------------------
DROP TABLE IF EXISTS `sys_read`;
CREATE TABLE `sys_read` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` bigint DEFAULT NULL COMMENT '学生id',
  `book_id` bigint DEFAULT NULL COMMENT '书籍id',
  `chapter_id` bigint DEFAULT NULL COMMENT '章节id',
  `finished` int DEFAULT NULL COMMENT '是否完成(0-未完成，1-完成阅读，2-完成答题)',
  `read_pages` int DEFAULT NULL COMMENT '阅读到多少页(finished为0时生效)',
  `record` int DEFAULT NULL COMMENT '积分(finished为2时生效)',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of sys_read
-- ----------------------------
BEGIN;
INSERT INTO `sys_read` VALUES (13, 109, 17, 21, 2, 924, 2);
INSERT INTO `sys_read` VALUES (14, 109, 17, 22, 1, 889, 0);
INSERT INTO `sys_read` VALUES (15, 106, 17, 21, 2, 925, 3);
INSERT INTO `sys_read` VALUES (16, 106, 17, 22, 2, 886, 5);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `role_id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID',
  `role_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色名称',
  `role_key` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色权限字符串',
  `role_sort` int NOT NULL COMMENT '显示顺序',
  `data_scope` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '1' COMMENT '数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）',
  `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '角色状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`role_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8 COMMENT='角色信息表';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES (1, '超级管理员', 'admin', 1, '1', '0', '0', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 15:56:33', '超级管理员');
INSERT INTO `sys_role` VALUES (2, '普通角色', 'common', 2, '2', '0', '2', 'admin', '2021-02-23 10:40:59', 'admin', '2021-02-24 15:56:22', '普通角色');
INSERT INTO `sys_role` VALUES (100, '学生', 'student', 1, '1', '0', '0', 'admin', '2021-02-24 17:51:55', '', '2021-02-25 09:55:15', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_dept
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_dept`;
CREATE TABLE `sys_role_dept` (
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `dept_id` bigint NOT NULL COMMENT '部门ID',
  PRIMARY KEY (`role_id`,`dept_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色和部门关联表';

-- ----------------------------
-- Records of sys_role_dept
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `role_id` bigint NOT NULL COMMENT '角色ID',
  `menu_id` bigint NOT NULL COMMENT '菜单ID',
  PRIMARY KEY (`role_id`,`menu_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色和菜单关联表';

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` VALUES (1, 1);
INSERT INTO `sys_role_menu` VALUES (1, 100);
INSERT INTO `sys_role_menu` VALUES (1, 101);
INSERT INTO `sys_role_menu` VALUES (1, 102);
INSERT INTO `sys_role_menu` VALUES (1, 103);
INSERT INTO `sys_role_menu` VALUES (1, 1000);
INSERT INTO `sys_role_menu` VALUES (1, 1001);
INSERT INTO `sys_role_menu` VALUES (1, 1002);
INSERT INTO `sys_role_menu` VALUES (1, 1003);
INSERT INTO `sys_role_menu` VALUES (1, 1004);
INSERT INTO `sys_role_menu` VALUES (1, 1005);
INSERT INTO `sys_role_menu` VALUES (1, 1006);
INSERT INTO `sys_role_menu` VALUES (1, 1007);
INSERT INTO `sys_role_menu` VALUES (1, 1008);
INSERT INTO `sys_role_menu` VALUES (1, 1009);
INSERT INTO `sys_role_menu` VALUES (1, 1010);
INSERT INTO `sys_role_menu` VALUES (1, 1011);
INSERT INTO `sys_role_menu` VALUES (1, 1012);
INSERT INTO `sys_role_menu` VALUES (1, 1013);
INSERT INTO `sys_role_menu` VALUES (1, 1014);
INSERT INTO `sys_role_menu` VALUES (1, 1015);
INSERT INTO `sys_role_menu` VALUES (1, 1016);
INSERT INTO `sys_role_menu` VALUES (1, 1017);
INSERT INTO `sys_role_menu` VALUES (1, 1018);
INSERT INTO `sys_role_menu` VALUES (1, 1019);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `user_id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  `dept_id` bigint DEFAULT NULL COMMENT '部门ID',
  `login_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '登录账号',
  `user_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户昵称',
  `user_type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '00' COMMENT '用户类型（00系统用户 01注册用户）',
  `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户邮箱',
  `phonenumber` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '手机号码',
  `sex` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '用户性别（0男 1女 2未知）',
  `avatar` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '头像路径',
  `password` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '密码',
  `salt` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '盐加密',
  `status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '帐号状态（0正常 1停用）',
  `del_flag` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '0' COMMENT '删除标志（0代表存在 2代表删除）',
  `login_ip` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '最后登录IP',
  `login_date` datetime DEFAULT NULL COMMENT '最后登录时间',
  `pwd_update_date` datetime DEFAULT NULL COMMENT '密码最后更新时间',
  `create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '创建者',
  `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '更新者',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COMMENT='用户信息表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES (1, 100, 'admin', '管理员', '00', 'hsy@163.com', '15999999999', '0', '', 'd5becb49d306e77e2a56319d04c29372', '699c4c', '0', '0', '127.0.0.1', '2021-03-29 22:28:26', '2021-02-24 17:17:18', 'admin', '2021-02-23 10:40:59', 'admin', '2021-03-29 22:28:26', '管理员');
INSERT INTO `sys_user` VALUES (100, 108, 'wjq', '王佳琪', '00', 'hsy1@163.com', '19999999999', '1', '', '2d769fb686447351c3b7762da25e3132', '0a97a3', '0', '2', '', NULL, NULL, 'admin', '2021-02-25 08:35:54', 'admin', '2021-02-25 09:55:29', '');
INSERT INTO `sys_user` VALUES (101, 108, 'aaa', 'dsa', '00', '809634576@qq.com', '13999999999', '0', '', 'd745ae6956b7beb502d8c318d2ff5f28', '2b7af2', '0', '2', '', NULL, NULL, 'admin', '2021-02-25 09:15:09', '', NULL, NULL);
INSERT INTO `sys_user` VALUES (102, 109, 'zhangs', '张三', '00', '8096345726@qq.com', '19999999929', '0', '', '43437025083eaf14e75e2bad34ddad64', 'e22b62', '0', '2', '', NULL, NULL, 'admin', '2021-03-02 17:09:08', '', NULL, NULL);
INSERT INTO `sys_user` VALUES (103, 103, 'zhangsan', '张三', '00', 'hsy11@163.com', '19999929991', '0', '', '40c43e58c98949a8218d9c63563d1c07', 'aa159a', '0', '0', '127.0.0.1', '2021-03-18 16:08:10', NULL, 'admin', '2021-03-05 15:19:47', '', '2021-03-18 16:08:09', NULL);
INSERT INTO `sys_user` VALUES (104, 108, 'lisi', '李四', '00', 'hsy123@163.com', '19999999329', '0', '', '11443cd185d5427d04806095116b7d7c', '173128', '0', '0', '36.5.44.4', '2021-03-27 01:05:10', NULL, 'admin', '2021-03-05 15:21:59', '', '2021-03-27 01:05:10', NULL);
INSERT INTO `sys_user` VALUES (105, 103, 'wangwu', '王五', '00', '1234567@qq.com', '13955177654', '0', '', 'a266b54437f005f65faae674df3f2be1', 'a94751', '0', '0', '36.5.44.4', '2021-03-27 00:59:25', NULL, 'admin', '2021-03-17 21:56:08', '', '2021-03-27 00:59:24', NULL);
INSERT INTO `sys_user` VALUES (106, 109, 'xiang', '阿祥', '00', '123456@qq.com', '123456789', '0', '', 'd8ed33a26eda243c466454a2bf8484a9', '94517d', '0', '0', '117.68.163.155', '2021-03-30 21:43:27', NULL, '', '2021-03-19 23:02:36', '', '2021-03-30 21:43:27', NULL);
INSERT INTO `sys_user` VALUES (107, 108, 'liyuan', '李源', '00', '809634536@qq.com', '18056098721', '1', '', '027b9e3a0d7f108f2ca3cae0b29d5a21', '53666f', '0', '0', '', NULL, NULL, 'admin', '2021-03-25 14:50:06', '', NULL, NULL);
INSERT INTO `sys_user` VALUES (108, 103, 'wangcheng', '王城', '00', '809624576@qq.com', '18051098751', '0', '', '459b0d63d1845231d98f5f6bbf8cf260', 'fd1390', '0', '0', '', NULL, NULL, 'admin', '2021-03-25 14:53:41', '', NULL, NULL);
INSERT INTO `sys_user` VALUES (109, 103, 'txl', '小五', '00', '1111', '1111', '0', '', 'c489b3815dd6c075d39b16297cb30192', '190dfe', '0', '0', '117.67.159.145', '2021-03-27 01:30:10', NULL, '', '2021-03-27 00:35:14', '', '2021-03-27 01:30:09', NULL);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `user_id` bigint NOT NULL COMMENT '用户ID',
  `role_id` bigint NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`user_id`,`role_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户和角色关联表';

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES (1, 1);
INSERT INTO `sys_user_role` VALUES (103, 100);
INSERT INTO `sys_user_role` VALUES (104, 100);
INSERT INTO `sys_user_role` VALUES (105, 100);
INSERT INTO `sys_user_role` VALUES (107, 100);
INSERT INTO `sys_user_role` VALUES (108, 100);
INSERT INTO `sys_user_role` VALUES (109, 100);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
